package com.zjitc;

import com.zaxxer.hikari.HikariDataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * Hello world!
 *
 */
public class App 
{

  public static void main(String[] args) {
    HikariDataSource dataSource=null;
    try{
      dataSource=new HikariDataSource();
      dataSource.setUsername("root");
      dataSource.setPassword("123456789");
      dataSource.setDriverClassName("com.mysql.jdbc.Driver");
      dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/test");

      try {
        Connection connection=dataSource.getConnection();
        System.out.println(connection);
        System.out.println("111");
      } catch (SQLException e) {
        e.printStackTrace();
      }
    }finally {
      if(dataSource!=null)
      {
        dataSource.close();
      }
    }
  }

}
